import jwt
from manageproject.settings import SECRET_KEY
# def getToken():
#     pass

class GetToken():
    #init需要设置盐值   唯一的
    def __init__(self):
        self.salt=SECRET_KEY

    #解密
    def jwt_decode(self,token):
        print(token)
        jwt.decode(token, self.salt, algorithms="HS256")
        return jwt.decode(token,self.salt,algorithms="HS256")


    #加密
    def jwt_encode(self,data):
        return jwt.encode(data,self.salt,algorithm="HS256")


g=GetToken()